package com.rc.saas.tenant.vo.order;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.rc.saas.tenant.common.enums.ElecPileStopReasonEnum;
import com.rc.saas.tenant.common.utils.StringUtil;

import java.math.BigDecimal;

public class SaasOrderInfoCountPrintVo {

    @ExcelProperty(value = "订单类型", index = 0)
    private String hlhtOrderTypeString;

    @ExcelProperty(value = "互联类型", index = 1)
    private String hlhtTypeString;

    @ExcelProperty(value = "所属公司", index = 2)
    private String companyName;

    @ExcelProperty(value = "站点名称", index = 3)
    private String stationName;

    @ExcelProperty(value = "枪编号", index = 4)
    private String gunNo;

    @ExcelIgnore
    private String status;

    @ExcelProperty(value = "订单号", index = 5)
    private String orderNum;

    @ExcelProperty(value = "外部订单号", index = 6)
    private String outOrderNum;

    @ExcelProperty(value = "会员名", index = 7)
    private String nickname;

    @ExcelProperty(value = "手机号", index = 8)
    private String mobile;

    @ExcelProperty(value = "车牌号", index = 9)
    private String carNumber;

    @ExcelProperty(value = "充电方式", index = 10)
    private String chargeType;

    @ExcelProperty(value = "开始时间", index = 11)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private String startTime;

    @ExcelProperty(value = "结算时间", index = 12)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private String endTime;

    @ExcelProperty(value = "充电时长", index = 13)
    private String lastTime;

    @ExcelProperty(value = "电量(度)", index = 14)
    private BigDecimal totalPower;

    @ExcelProperty(value = "电费(元)",index = 15)
    private BigDecimal totalElecMoney;

    @ExcelProperty(value = "服务费(元)",index = 16)
    private BigDecimal totalSeviceMoney;

    @ExcelProperty(value = "总价格(元)",index = 17)
    private BigDecimal totalMoney;

    @ExcelProperty(value = "第三方优惠(元)",index = 18)
    private BigDecimal discountAmount;

    @ExcelProperty(value = "第三方实付(元)",index = 19)
    private BigDecimal payAmount;

    @ExcelProperty(value = "saas优惠(元)",index = 20)
    private BigDecimal saasDiscountAmount;

    @ExcelProperty(value = "saas实付(元)",index = 21)
    private BigDecimal saasPayAmount;


    @ExcelIgnore
    private BigDecimal discountServiceAmount;

//    @ExcelProperty(value = "充电时长")
//    private String lastTime;


    /**
     * 停止方式
     * 0: 用户手动停止充电；
     * 1: 客户归属地运营商平台停止充电；
     * 2: BMS 停止充电；
     * 3: 充电机网络异常；
     * 4: 连接器断开
     * 5: 电价异常
     * 6: 余额不足
     * 7: 电流过低停止
     * 8: 充满平台停止
     * 9: 充满停止
     * 10: 电池温度过高停止
     * 11: 电流过高
     * 12: 电压过高
     * 13: 订单已结算
     */
    @ExcelIgnore
    private String stopReason;


    @ExcelIgnore
    private Integer pileStopReason;

    @ExcelIgnore
    private String pileStopReasonResult;


    @ExcelIgnore
    private String bizType;


    @ExcelIgnore
    private String orderInfoHlhtType;

    @ExcelIgnore
    private String hlhtOrderType;

    /**
     * 互联互通内部订单
     */
    @ExcelIgnore
    private String hlhtTenantCode;

    @ExcelIgnore
    private String hlhtOperatorId;


    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public String getOutOrderNum() {
        return outOrderNum;
    }

    public void setOutOrderNum(String outOrderNum) {
        this.outOrderNum = outOrderNum;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public BigDecimal getTotalPower() {
        return totalPower;
    }

    public void setTotalPower(BigDecimal totalPower) {
        this.totalPower = totalPower;
    }

    public BigDecimal getTotalElecMoney() {
        return totalElecMoney;
    }

    public void setTotalElecMoney(BigDecimal totalElecMoney) {
        this.totalElecMoney = totalElecMoney;
    }

    public BigDecimal getTotalSeviceMoney() {
        return totalSeviceMoney;
    }

    public void setTotalSeviceMoney(BigDecimal totalSeviceMoney) {
        this.totalSeviceMoney = totalSeviceMoney;
    }

    public BigDecimal getDiscountServiceAmount() {
        return discountServiceAmount;
    }

    public void setDiscountServiceAmount(BigDecimal discountServiceAmount) {
        this.discountServiceAmount = discountServiceAmount;
    }

    public BigDecimal getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(BigDecimal totalMoney) {
        this.totalMoney = totalMoney;
    }

    public BigDecimal getDiscountAmount() {
        return discountAmount;
    }

    public void setDiscountAmount(BigDecimal discountAmount) {
        this.discountAmount = discountAmount;
    }

    public BigDecimal getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(BigDecimal payAmount) {
        this.payAmount = payAmount;
    }

    public String getCarNumber() {
        return carNumber;
    }

    public void setCarNumber(String carNumber) {
        this.carNumber = carNumber;
    }

    public String getStopReason() {
        return stopReason;
    }

    public void setStopReason(String stopReason) {
        this.stopReason = stopReason;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getLastTime() {
        return lastTime;
    }

    public void setLastTime(String lastTime) {
        this.lastTime = lastTime;
    }

    public Integer getPileStopReason() {
        return pileStopReason;
    }

    public void setPileStopReason(Integer pileStopReason) {
        this.pileStopReason = pileStopReason;
    }

    public String getPileStopReasonResult() {
        return ElecPileStopReasonEnum.getElecPileStopReasonResult(this.pileStopReason);
    }

    public void setPileStopReasonResult(String pileStopReasonResult) {
        this.pileStopReasonResult = pileStopReasonResult;
    }

    public String getStationName() {
        return stationName;
    }

    public void setStationName(String stationName) {
        this.stationName = stationName;
    }

    public String getBizType() {
        return bizType;
    }

    public void setBizType(String bizType) {
        this.bizType = bizType;
    }

    public String getCompanyName() {
        if ("0".equals(orderInfoHlhtType)) {
            if ("0".equals(hlhtOrderType)) {
                return companyName;
            } else if ("1".equals(hlhtOrderType)) {
                return companyName;
            } else if ("2".equals(hlhtOrderType)) {
                return "";
            }
        } else if ("1".equals(orderInfoHlhtType)) {
            if ("1".equals(hlhtOrderType)) {
                return companyName;
            } else if ("2".equals(hlhtOrderType)) {
                return "";
            }
        } else if ("2".equals(orderInfoHlhtType)) {
            return "";
        } else if ("3".equals(orderInfoHlhtType)) {
            return companyName;
        }
        return "";
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getHlhtOrderTypeString() {
        if ("0".equals(orderInfoHlhtType)) {
            if ("0".equals(hlhtOrderType)) {
                return "自有订单";
            } else if ("1".equals(hlhtOrderType)) {
                return "反向订单";
            } else if ("2".equals(hlhtOrderType)) {
                return "正向订单";
            }
        } else if ("1".equals(orderInfoHlhtType)) {
            if ("1".equals(hlhtOrderType)) {
                return "反向订单";
            } else if ("2".equals(hlhtOrderType)) {
                return "正向订单";
            }
        } else if ("2".equals(orderInfoHlhtType)) {
            return "正向订单";
        } else if ("3".equals(orderInfoHlhtType)){
            return "正向内部外联订单";
        }
        return "";
    }

    public void setHlhtOrderTypeString(String hlhtOrderTypeString) {
        this.hlhtOrderTypeString = hlhtOrderTypeString;
    }

    public String getOrderInfoHlhtType() {
        return orderInfoHlhtType;
    }

    public void setOrderInfoHlhtType(String orderInfoHlhtType) {
        this.orderInfoHlhtType = orderInfoHlhtType;
    }

    public String getHlhtOrderType() {
        return hlhtOrderType;
    }

    public void setHlhtOrderType(String hlhtOrderType) {
        this.hlhtOrderType = hlhtOrderType;
    }

    public String getHlhtTypeString() {
        if ("0".equals(orderInfoHlhtType)) {
            if ("0".equals(hlhtOrderType)) {
                return "";
            } else if (StringUtil.isNotBlank(hlhtTenantCode) && !StringUtil.isNotBlank(hlhtOperatorId)) {
                return "内部互联";
            } else {
                return "外部互联";
            }
        } else if ("1".equals(orderInfoHlhtType)) {
            return "内部互联";
        } else if ("3".equals(orderInfoHlhtType)){
            return "外部互联";
        } else {
            return "内部互联";
        }
    }

    public void setHlhtTypeString(String hlhtTypeString) {
        this.hlhtTypeString = hlhtTypeString;
    }

    public String getHlhtTenantCode() {
        return hlhtTenantCode;
    }

    public void setHlhtTenantCode(String hlhtTenantCode) {
        this.hlhtTenantCode = hlhtTenantCode;
    }

    public String getHlhtOperatorId() {
        return hlhtOperatorId;
    }

    public void setHlhtOperatorId(String hlhtOperatorId) {
        this.hlhtOperatorId = hlhtOperatorId;
    }

    public String getGunNo() {
        return gunNo;
    }

    public void setGunNo(String gunNo) {
        this.gunNo = gunNo;
    }

    public String getChargeType() {
        return chargeType;
    }

    public void setChargeType(String chargeType) {
        this.chargeType = chargeType;
    }

    public BigDecimal getSaasDiscountAmount() {
        return saasDiscountAmount;
    }

    public void setSaasDiscountAmount(BigDecimal saasDiscountAmount) {
        this.saasDiscountAmount = saasDiscountAmount;
    }

    public BigDecimal getSaasPayAmount() {
        return saasPayAmount;
    }

    public void setSaasPayAmount(BigDecimal saasPayAmount) {
        this.saasPayAmount = saasPayAmount;
    }
}
